package com.cnap.model.intelligent;

import cn.hutool.core.util.IdUtil;
import com.cnap.db.entity.DeployClusterPO;

import java.time.LocalDateTime;
import java.time.ZoneId;

/**
 * <类文件描述>
 *
 * @author xc
 **/
public class NotifyClusterInfoDTO {
    private String svcId;
    private String clusterName;
    private String providerName;
    private String ip;
    private String innerIp;

    /**
     * get
     *
     * @return SvcId
     */
    public String getSvcId() {
        return svcId;
    }

    /**
     * set
     *
     * @param svcId svcId
     */
    public void setSvcId(String svcId) {
        this.svcId = svcId;
    }

    /**
     * get
     *
     * @return ClusterName
     */
    public String getClusterName() {
        return clusterName;
    }

    /**
     * set
     *
     * @param clusterName clusterName
     */
    public void setClusterName(String clusterName) {
        this.clusterName = clusterName;
    }

    /**
     * get
     *
     * @return ProviderName
     */
    public String getProviderName() {
        return providerName;
    }

    /**
     * set
     *
     * @param providerName providerName
     */
    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    /**
     * get
     *
     * @return Ip
     */
    public String getIp() {
        return ip;
    }

    /**
     * set
     *
     * @param ip ip
     */
    public void setIp(String ip) {
        this.ip = ip;
    }

    /**
     * get
     *
     * @return InnerIp
     */
    public String getInnerIp() {
        return innerIp;
    }

    /**
     * set
     *
     * @param innerIp innerIp
     */
    public void setInnerIp(String innerIp) {
        this.innerIp = innerIp;
    }

    /**
     * 转换成po
     *
     * @return 结果
     */
    public DeployClusterPO tpDeployClusterPO() {
        DeployClusterPO po = new DeployClusterPO();
        po.setId(IdUtil.simpleUUID());
        po.setServiceId(this.svcId);
        po.setClusterName(this.clusterName);
        po.setId(this.ip);
        po.setInnerIp(this.innerIp);
        po.setCreateTime(LocalDateTime.now(ZoneId.of("Asia/Shanghai")));
        return po;
    }

    /**
     * 转换
     *
     * @return 结果
     */
    public IntelligentClusterInfo toIntelligentClusterInfo() {
        IntelligentClusterInfo clusterInfo = new IntelligentClusterInfo();
        clusterInfo.setProvider(this.providerName);
        clusterInfo.setClusterName(this.clusterName);
        return clusterInfo;
    }
}
